
<template>
  <div>
    <div class="answerlist">
      <c-title :hide="false" text="答题列表"></c-title>
      <div class="head">
        <div class="left">
          <div>{{status1}}</div>
          <div>答对数量</div>
        </div>
        <div class="rtight">
          <div>{{status}}</div>
          <div>答错数量</div>
        </div>
      </div>
      <div class="answerlist" style="border-bottom: 1px solid #e8e8e8;">
        <div class="answerlist-item" v-for="(item, index) in answerList" :key="index">
          <div class="answerlist-item-title">
            <span>{{ item.sub_name }}</span>
          </div>
          <div class="answerlist-item-content" style="margin-top: 15px;
}">
            <span v-if="item.status == 0" class="error">错误</span>
            <span v-else class="success">正确</span>
            <span style="margin-left: 30px">我的选择：{{item.xz}}</span>
          </div>

        </div>
      </div>
    </div>
  </div>
</template>

<script>
import cTitle from "components/title";
import { Toast } from "vant";
export default {
  data() {
    return {
      status: 0,
      status1: 0,
      answerList: [

      ]
    };
  },
  components: { cTitle },
  mounted() {
    this.getData();
  },
  methods: {
    //获取数据
    getData() {
      $http
        .get("test.getvideo", {}, "加载中")
        .then(
          response => {
            if (response.result === 1) {
              this.answerList = response.data.list;
              this.status = response.data.status
              this.status1 = response.data.status1
            } else {
              Toast(response.msg);
            }
          },
          response => {
            console.log(response.msg);
          }
        );
    }
  }
};
</script>
<style scoped lang="scss">
.head {
  display: flex;
  background: #ea3131;
  justify-content: space-between;
  padding: 10px;
  color: white;
  margin-bottom: 10px;
}
.left{
  width: 50%;
}
.rtight{
  width: 50%;
}
.answerlist-item{
  background: white;
  padding: 10px;
}
.answerlist-item{
  text-align: left;
}
.error {
  background: #ffd0d0;
  color: red;
  padding: 2px 5px 2px 5px;
  border-radius: 2px;
}
.success {
  background: #d7e9fb;
  color: #409eff;
  padding: 2px 5px 2px 5px;
  border-radius: 2px;
}
</style>